package ducna.misscall.screen.main.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;
import ducna.misscall.screen.about.AboutFragment;
import ducna.misscall.screen.contact.ContactFragment;
import ducna.misscall.screen.misscall.MainMissCallFragment;
import ducna.misscall.screen.setting.SettingFragment;

/**
 * @author DUCNA
 */
public class MainFragmentPagerAdapter extends FragmentPagerAdapter {

	public MainFragmentPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int position) {
		Fragment fragment = null;
		switch (position) {
		case 0:
			fragment = new MainMissCallFragment();
			break;
		case 1:
			fragment = new AboutFragment();
			break;
		case 2:
			fragment = new ContactFragment();
			break;
		case 3:
			fragment = new SettingFragment();
			break;
		default:
			break;
		}
		return fragment;
	}

	@Override
	public int getCount() {
		return 4;
	}

	@Override
	public int getItemPosition(Object object) {
		return POSITION_NONE;
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		super.destroyItem(container, position, object);
	}
}
